package net.myjung.spring;

import java.util.ArrayList;
import java.util.List;

import net.myjung.model.BaseObject;
import net.myjung.model.annotation.MdlAttribute;
import net.myjung.model.annotation.MdlClass;
import net.myjung.model.annotation.MdlElement;
import net.myjung.model.annotation.MdlField;

@MdlClass(name = "Bean")
@SuppressWarnings("serial")
public class SprBean extends BaseObject {
	@MdlField(type = "net.myjung.spring.SprBeans")
	private SprBeans _parent;
	@MdlAttribute(type = "string")
	private String id;
	@MdlAttribute(name = "class", type = "string")
	private String clazz;
	@MdlAttribute(name = "factory-bean", type = "string")
	private String factory_bean;
	@MdlAttribute(name = "factory-method", type = "string")
	private String factory_method;
	@MdlElement(type = "net.myjung.spring.Property")
	private List<SprProperty> property;

	public SprBeans get_parent() {
		return _parent;
	}
	public void set_parent(SprBeans _parent) {
		this._parent = _parent;
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getClazz() {
		return clazz;
	}
	public void setClazz(String clazz) {
		this.clazz = clazz;
	}
	public String getFactory_bean() {
		return factory_bean;
	}
	public void setFactory_bean(String factory_bean) {
		this.factory_bean = factory_bean;
	}
	public String getFactory_method() {
		return factory_method;
	}
	public void setFactory_method(String factory_method) {
		this.factory_method = factory_method;
	}
	public List<SprProperty> getProperty() {
		return property;
	}
	public void setProperty(List<SprProperty> property) {
		this.property = property;
	}
	public void addProperty(SprProperty property) {
		if (this.property == null)
			this.property = new ArrayList<SprProperty>();
		this.property.add(property);
	}
	public void removeProperty(SprProperty property) {
		if (this.property == null || !this.property.contains(property))
			return;
		this.property.remove(property);
	}
}